import java.util.Scanner;
public class Test
{
    public static void main(String[] arg)
    {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext())
        {int a = sc.nextInt();
            int b = sc.nextInt();
            int e = a;
            int f = b;
            if(a<b)
            {
                int c = b%a;
                if(c==0){
                    System.out.println(a +" "+ b);
                }
                else{
                    while(a%c!=0)
                    {
                        c= a%c;
                        a =a/c;
                    }
                    int d = f/c*e;
                    System.out.println(c +" "+ d);
                }
            }
            else
            {
                int c = a%b;
                if(c==0){
                    System.out.println(b +" "+ a);
                }else{
                    while(b%c!=0)
                    {
                        c= b%c;
                        a =a/c;
                    }
                    int d = e/c*f;

                    System.out.println(c +" "+ d);
                }
            }
        }
    }
}
